home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / include / show.php < prev    next >
Encoding:
PHP Script  |  2002-10-28  |  1.2 KB  |  75 lines

  1. <?
  2. // *******************************************************************
  3. //  include/show.php
  4. // *******************************************************************
  5.  
  6. if(!isset($sr)){
  7.     
  8.     $sr=0;
  9. }
  10.  
  11. $get_sites_count = sql_query("
  12.     select
  13.         ID
  14.     from
  15.         $tb_links
  16. ");
  17.  
  18. $total_sites = sql_num_rows($get_sites_count);
  19.  
  20. $sql = "
  21.     select
  22.         $tb_links.ID as site_id,
  23.         $tb_links.SiteName as site_name,
  24.         $tb_links.SiteURL as site_url,
  25.         $tb_categories.Category as category_name,
  26.         $tb_categories.ID as cat_id,
  27.         $tb_links.Added as added,
  28.         $tb_links.LastUpdate as last_update,
  29.         $tb_links.Description as site_description,
  30.         $tb_links.Country as country,
  31.         $tb_links.HitsIn as hits_in,
  32.         $tb_links.HitsOut as hits_out,
  33.         count($tb_reviews.ID) as total_reviews
  34.     from
  35.         $tb_links
  36.     left join
  37.         $tb_categories
  38.     on
  39.         $tb_links.Category = $tb_categories.ID
  40.     left join
  41.         $tb_reviews
  42.     on
  43.         $tb_links.ID = $tb_reviews.SiteID
  44.     group by
  45.         site_id
  46.     order by 
  47. ";
  48.  
  49. if($show == "new"){
  50.     
  51.     $sql .= "last_update ";
  52. }
  53.  
  54. if($show == "cool"){
  55.     
  56.     $sql .= "hits_in ";
  57. }
  58.  
  59. if($show == "pop"){
  60.     
  61.     $sql .= "hits_out ";
  62. }
  63.  
  64. $sql .= "
  65.         desc
  66.     limit
  67.         $sr, $pp
  68. ";
  69.  
  70. $get_sites = sql_query($sql);
  71.  
  72. echo draw_sites($total_sites, $get_sites);
  73.  
  74. ?>
  75.